import Vue from 'vue'
import VueRouter from 'vue-router'




import Layout from "../layout/index";



Vue.use(VueRouter)

const constantRoutes = [
  {
    path: '/',
    component: Layout,
    redirect: 'index',
    children:[
      {
        path:'index',
        component: ()=>import("@/views/index/index"),
      },
      {
        path: 'article/:id',
        name: 'Article',
        component:()=>import("@/views/articleCon/articleCon"),
        meta: {
          keepAlive: true //需要被缓存
        }
      },
    ]
  },
  {
    path: '/text',
    component: ()=>import("@/views/textEditor/textEditor"),
  },

]

const router = new VueRouter({
  //mode: 'hash',
  base: process.env.BASE_URL,
  routes:constantRoutes,
})

export default router
